package com.chixing.service.impl;

import com.chixing.mapper.CustomerMapper;
import com.chixing.pojo.Customer;
import com.chixing.service.PersonalcenterService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author dwe
 * @date 2021-10-08 18:26
 */

@Service
public class PersonalcenterServiceImpl implements PersonalcenterService {

    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public ServerResponse getById(Integer id) {
        Customer customer = customerMapper.selectByPrimaryKey(id);
        if (customer != null)
            return ServerResponse.getSuccess(customer);
        return ServerResponse.getFail(null);
    }
}
